package com.project.entity;

import java.io.Serializable;
import javax.persistence.*;

import java.sql.Date;
import java.util.Collection;
import java.util.Collections;
import java.util.List;


/**
 * The persistent class for the Property database table.
 * 
 */
@Entity
@Table(name="Property")
@NamedQueries({
	@NamedQuery(name = "Property.findAllProperty", query = "SELECT pro FROM Property pro"),
	@NamedQuery(name = "Property.findAllPropertyFromAccount", query = "select pro from Property pro WHERE pro.account.accID = :accID")
})
public class Property implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="PropID")
	private String propID;

    @Lob()
	@Column(name="Address")
	private String address;

	@Column(name="Country")
	private String country;

    @Lob()
	@Column(name="Description")
	private String description;

	@Column(name="PostDate",insertable=false)
	private Date postDate;

	@Column(name="State")
	private String state;

	@Column(name="Status",insertable=false,updatable=true)
	private boolean status;

    @Lob()
	@Column(name="Title")
	private String title;

	//bi-directional one-to-one association to PropForRent
	@OneToOne(cascade = CascadeType.ALL ,mappedBy="property")
	private PropForRent propForRent;

	//bi-directional one-to-one association to PropForSale
	@OneToOne(cascade = CascadeType.ALL ,mappedBy="property")
	private PropForSale propForSale;

	//bi-directional many-to-one association to Account
    @ManyToOne
	@JoinColumn(name="AccID")
	private Account account;

	//bi-directional many-to-one association to Property_Image
	@OneToMany(mappedBy="property",cascade = CascadeType.ALL,orphanRemoval=true)
	private List<Property_Image> propertyImages;

	//bi-directional one-to-one association to RoomForRent
	@OneToOne(cascade = CascadeType.ALL ,mappedBy="property")
	private RoomForRent roomForRent;

	//bi-directional many-to-one association to VisitLog
	@OneToMany(mappedBy="property",cascade = CascadeType.ALL)
	private List<VisitLog> visitLogs;


    public Property() {
    	
    }



	public String getPropID() {
		return this.propID;
	}

	public void setPropID(String propID) {
		this.propID = propID;
	}

	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getCountry() {
		return this.country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Date getPostDate() {
		return this.postDate;
	}

	public void setPostDate(Date postDate) {
		this.postDate = postDate;
	}

	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public boolean getStatus() {
		return this.status;
	}

	public void setStatus(boolean status) {
		this.status = status;
	}

	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public PropForRent getPropForRent() {
		return this.propForRent;
	}

	public void setPropForRent(PropForRent propForRent) {
		this.propForRent = propForRent;
	}
	
	public PropForSale getPropForSale() {
		return this.propForSale;
	}

	public void setPropForSale(PropForSale propForSale) {
		this.propForSale = propForSale;
	}
	
	public Account getAccount() {
		return this.account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}
	
	public List<Property_Image> getPropertyImages() {
		return this.propertyImages;
	}

	public void setPropertyImages(List<Property_Image> propertyImages) {
		this.propertyImages = propertyImages;
	}
	
	public RoomForRent getRoomForRent() {
		return this.roomForRent;
	}

	public void setRoomForRent(RoomForRent roomForRent) {
		this.roomForRent = roomForRent;
	}
	
	public List<VisitLog> getVisitLogs() {
		return this.visitLogs;
	}

	public void setVisitLogs(List<VisitLog> visitLogs) {
		this.visitLogs = visitLogs;
	}
	
}